package demo1;

public class Test {
    public static void main(String[] args)
                    throws CloneNotSupportedException {
            Person person1 = new Person("zhangsan", 10);
            Person person2 = (Person) person1.clone();//person1拷贝一份 赋给person2
            System.out.println("before:" + person1.m.money);
            System.out.println("before:" + person2.m.money);

            person2.m.money = 99.9;
            System.out.println("after:" + person1.m.money);
            System.out.println("after:" + person2.m.money);

    }

}
